﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace QLCH_ANUONG.Forms
{
    public partial class frmNguoiDung : Form
    {
        public frmNguoiDung()
        {
            InitializeComponent();
            string strTag = Convert.ToString(this.Tag);
            clsMain.flexConn.InitForms(strTag, ref fcListView);
            clsMain.flexConn.InitForms(strTag, ref fcButton);
            clsMain.flexConn.InitForms(strTag, ref fctxtMaso);
            clsMain.flexConn.InitForms(strTag, ref fctxtTen);
            clsMain.flexConn.InitForms(strTag, ref fctxtMatKhau);
            clsMain.flexConn.InitForms(strTag, ref fctxtNhanVien);

        }

        private void fcListView_DoubleClick(object sender, EventArgs e)
        {
            try
            {
                fcButton.ChangeState(FlexControls.flexControls.STATE_UPDATE);
                clsMain.flexConn.AddDataToControll(fcListView.strSelectItemCode, Convert.ToString(this.Tag), clsMain.flexConn.fcConn);
            }
            catch (Exception ex)
            {
                MessageBox.Show("fcButton click" + ex.ToString());
            }
        }

        private void fcButton_Click(object sender, EventArgs e)
        {
            try
            {
                clsMain.flexConn.fcButton_Click(Convert.ToString(this.Tag),ref fcButton, clsMain.flexConn.fcConn);
            }
            catch (Exception ex)
            {
                MessageBox.Show("fcButton click \n" + ex.ToString());
            }

        }

        private void frmNguoiDung_KeyDown(object sender, KeyEventArgs e)
        {
            if (e.KeyCode.Equals(System.Windows.Forms.Keys.Escape))
            {
                this.Visible = false;
            }
        }

        private void fctxtNhanVien_Load(object sender, EventArgs e)
        {

        }

        private void fcListView_Load(object sender, EventArgs e)
        {

        }

        private void frmNguoiDung_Load(object sender, EventArgs e)
        {

        }


       


    }
}
